<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<link rel="stylesheet" type="text/css" href="${path}/css/main.css">
		<link rel="stylesheet" type="text/css" href="${path}/css/mainTable.css">
		<script type="text/javascript">
			function remove(id,name){
				if(confirm("删除后无法恢复!你确定要删除吗?")){
					var actionUrl = "${path}/configLowerPartner/deleteConfigLowerPartner.action";
					var params = "configLowerPartnerVo.id="+id+"&configLowerPartnerVo.name="+name;
					params = encodeURI(params);
					params = encodeURI(params);
					window.location.href=actionUrl+'?'+params;
				}
			}
		</script>
	</head>
	<body>
		<div>
			<p>
				新增渠道信息：
				<a href="${path}/configLowerPartner/addConfigLowerPartner.action?configLowerPartnerVo.id=0" title="新增渠道">添加</a>
			</p>
			<table>
				<thead>
					<tr>
						<th>渠道编号</th>
						<th>渠道名称</th>
						<th>渠道详情</th>
						<th>渠道用户名</th>
						<th>操作</th>
					</tr>
				</thead>
				<c:choose>
					<c:when test="${configLowerPartnerVoList != null && fn:length(configLowerPartnerVoList) > 0}">
						<c:forEach var="configLowerPartnerVo" items="${configLowerPartnerVoList }" varStatus="list">
							<tr style="${list.index%2 != 0 ? 'background-color: #fea;' : 'background-color: #fff;' }">
								<td>${configLowerPartnerVo.id }</td>
								<td>
									<a href="${path}/configLowerPartner/editConfigLowerPartner.action?configLowerPartnerVo.id=${configLowerPartnerVo.id }" title="编辑">${configLowerPartnerVo.name }</a>
								</td>
								<td>${configLowerPartnerVo.detail }</td>
								<td>
									<c:if test="${userInfoVoList != null && fn:length(userInfoVoList) > 0 }">
										<c:forEach items="${userInfoVoList }" var="userInfoVo" varStatus="i">
											<c:if test="${userInfoVo.id == configLowerPartnerVo.user_id }">${userInfoVo.login_username }</c:if>
										</c:forEach>
									</c:if>
								</td>
								<td>
									<a href="javascript:remove(${configLowerPartnerVo.id }, '${configLowerPartnerVo.name }');">删除</a>
								</td>
							</tr>
						</c:forEach>
					</c:when>
					<c:otherwise>
		    			<tr>
		    				<td>暂无渠道信息</td>
		    			</tr>
		    		</c:otherwise>
				</c:choose>
			</table>
		</div>
	</body>
</html>